package com.way.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController {

    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "/echo/{message}")
    public String echo(@PathVariable("message") String message) {
        return restTemplate.getForObject("http://nacos-provider/echo/" + message, String.class);
    }

}
